function init() {
    for (let inputBox of document.getElementsByTagName('input')) {
        inputBox.setAttribute("autoComplete","off");
        inputBox.addEventListener('focus',function () {
            this.parentElement.style.setProperty("border-color","#4285f4");
        })
        inputBox.addEventListener('blur',function () {
            this.parentElement.style.setProperty("border-color","#9F9F9F");
        })
    }
    if(!(('localStorage' in window)&&(window.localStorage !==null))){
        alert("业问目前不支持您的浏览器");
    }
    
}
init();

function loginCheck() {
    if ($("#uID").val()===""||$("#uPassword").val()===""){
        alert("请输入");
        return;
    }
    $.ajax({
        type:"POST",
        url:gOptions.defaultURLPrefix+"/yewen/account/loginAuth",
        data:{"id":$("#uID").val(),"password":$("#uPassword").val()},
        // data:{"id":"admin","password":"123456"},
        dataType:"json",
        success:function (data) {
            if (data.code===0){
                /*登陆成功*/
                localStorage.setItem("id",$("#uID").val());
                location.replace(gOptions.defaultURLPrefix+"/yewen/pages/home?id="+$("#uID").val());
            }else if (data.code===50000){
                $("#infoBox").css("visibility","visible")
            }else {
                layui.alert("服务器繁忙，请稍后再试")
            }
        }
    })

}
